package com.happyass.show.service.impl;

import com.happyass.show.dao.ActivityDao;
import com.happyass.show.dao.AddrDao;
import com.happyass.show.entity.Activity;
import com.happyass.show.entity.Addr;
import com.happyass.show.service.AddrService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * TODO
 *
 * @author admin
 * @date 2021/1/12 10:37
 *
 * <P></P>
 **/

@Service
public class AddrServiceImpl implements AddrService {
    @Autowired
    AddrDao addrDao;
    @Autowired
    ActivityDao activityDao;

    @Override
    public List<Addr> findAll() {
        return addrDao.findAll();
    }

    @Override
    public List<Addr> findExceptActivityAddr(Integer activityId) {
        Activity activity = activityDao.findByActivityId(activityId);
        List<Addr> addrList = addrDao.selectWithoutAddr(activity.getActivityAddr());
        return addrList;
    }
}
